﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.InteropServices.WindowsRuntime;
using System.Xml;
using Windows.Foundation;
using Windows.Foundation.Collections;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
using Windows.UI.Xaml.Controls.Primitives;
using Windows.UI.Xaml.Data;
using Windows.UI.Xaml.Input;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml.Navigation;
using Windows.UI.Xaml.Shapes;

// Hello ProjectQuests!

// The Blank Page item template is documented at http://go.microsoft.com/fwlink/?LinkId=234238

namespace ProjectQuests_Prototype2D
{
    /// <summary>
    /// An empty page that can be used on its own or navigated to within a Frame.
    /// </summary>
    public sealed partial class MainPage : Page
    {
        private ResourceDictionary _EasyQuestResourceDictionary;

        public MainPage()
        {
            this.InitializeComponent();
            statusBox.Text = "Greetings Traveller I am your Guide";

        }

        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.  The Parameter
        /// property is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
               Grid.SetColumn(rect1,  1);
               LevelGeneration();
        }

       

        private void EasyQuest_Click(object sender, Windows.UI.Xaml.RoutedEventArgs e)
        {
            
            EasyQuestStoryboard1.Begin();
           
        }

        private void LevelGeneration()
        {
            int xMax = 5;
            int yMax = 4;

            for (int x = 0; x < xMax; x++)
            {        
                for (int y = 0; y < yMax; y++)
                {
                    Level.ucCor_4way xPiece = new Level.ucCor_4way();
                    levelGrid.Children.Add(xPiece);
                    Grid.SetColumn(xPiece, x);
                    Grid.SetRow(xPiece, y);
                }
            }
            
        }
       
    }

   
}
